package com.yxq.mdt.app.modules.market.ui;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yxq.mdt.app.R;
import com.yxq.mdt.app.glide.GlideHelper;
import com.yxq.mdt.app.modules.market.bean.MallResponseBean;

import java.util.List;

/**
 * @author L
 * @time 2019-10-21
 * @describe 商城顶部菜单数据适配器
 */
public class MainMallGridMenuListAdapter extends BaseQuickAdapter<MallResponseBean.NavIconListBean, BaseViewHolder> {


    public MainMallGridMenuListAdapter(int layoutResId, @Nullable List<MallResponseBean.NavIconListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MallResponseBean.NavIconListBean item) {

        ImageView icon = helper.getView(R.id.main_item_iv_grid_icon);
        GlideHelper.setLoadImage(mContext, item.getPic_url(),  R.color.gray, icon);
        helper.setText(R.id.main_item_tv_grid_title, item.getName());
    }
}
